﻿@model List<GameSchool.Models.ViewModels.NewsItemViewModel>

@if (User.IsInRole("Admin") || Model[0].isTeacher == true)
{
    <p>@Html.ActionLink("Bæta við frétt", "Create/", "News")</p>
}
        
                    <h2>@ViewBag.Message</h2>
                    @foreach (var m in Model)
                    {    <section class="newsItem three-quarters">
                            <h4>@m.Course</h4>
                            <h6>@m.date</h6>
                            <h5>@m.Title</h5>
                            <p>@m.Body</p>
                            <h6>@m.Author</h6>
                                                        @if(User.IsInRole("Admin") || m.isTeacher == true){
                                   <p> @Html.ActionLink("Eyða frétt", "Delete/" + @m.ID, "News")   -    @Html.ActionLink("Breyta frétt", "Edit/" + @m.ID, "News")</p>
                                                        }
                            </section>
                    }

